package linwen.wang.hello.controller;

import linwen.wang.common.resp.BaseResp;
import linwen.wang.hello.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName HelloController
 * @Description
 * @Author lin
 * @Date 2021/12/16 上午1:28
 * @Version V1.0
 */

@RestController
public class HelloController {

    @Autowired
    private UserService userService;

    @GetMapping("/get/hello")
    public BaseResp<String> hello() {
        return BaseResp.success("success");
    }

    @GetMapping("/user/{id}")
    public BaseResp getUserById(@PathVariable("id") String id) {
        return userService.getUserById(id);
    }
}
